package setup

import (
	"context"
	"device_mq_handler/internal/pkg/instance"
	"gitee.com/lailonghui/vehicle-supervision-framework/pkg/loggers"
	kitLog "github.com/go-kit/kit/log"
	kitZaplog "github.com/go-kit/kit/log/zap"
)

// 日志初始化
func LoggerInit(ctx context.Context) {
	config := instance.GetConfig()

	appLogger := loggers.NewLogger("app", "runtime/logs", loggers.ParseLevel(config.Log.Level), loggers.ParseMode(config.Log.Mode))
	instance.SetAppLog(appLogger)

	var klog kitLog.Logger = kitZaplog.NewZapSugarLogger(appLogger, loggers.ParseLevel(config.Log.Level))
	instance.SetKitLog(klog)

}
